package cn.gson.querydsl.service;

import cn.gson.querydsl.entity.QUser;
import cn.gson.querydsl.entity.User;
import cn.gson.querydsl.plugin.BlazeJPAQueryFactory;
import cn.gson.querydsl.transaction.InjectDsl;
import com.querydsl.jpa.JPQLQueryFactory;
import org.noear.solon.annotation.Component;

import java.util.List;

/**
 * <p>****************************************************************************</p>
 * <ul style="margin:15px;">
 * <li>Description : querydsl-solon-plugin</li>
 * <li>Version     : 1.0</li>
 * <li>Creation    : 2024年07月20日</li>
 * <li>@author     : ____′↘夏悸</li>
 * </ul>
 * <p>****************************************************************************</p>
 */
@Component
public class UserServive {
    @InjectDsl
    private BlazeJPAQueryFactory factory;

    @InjectDsl
    private JPQLQueryFactory jqf;

    private QUser qUser = QUser.user;

    public List<User> list() {
        return factory.selectFrom(qUser).fetch();
    }
}
